<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>无标题文档</title>
<style type="text/css">
<!--
#items {
	width: 900px;
	height: auto;
	margin: 0 auto;
	padding: 5px 0;
	clear: both;
	font-size: 16px;
}

#items ul, #items li {
	list-style: none;
}

#items li {
	width: 800px;
	height: 30px;
	text-align: right;
	background-image:
		url(${ pageContext.request.contextPath }/resources/images/li_ico.png);
	background-repeat: no-repeat;
	text-indent: 15px;
	background-position: 0px center;
	padding-left: 0px;
	line-height: 30px;
	color: #CCC;
	border-bottom: dashed 1px #CCC;
	background-position: 0px center;
}

#items li a {
	float: left;
	text-align: left;
	line-height: 30px;
	color: #666;
	text-decoration: none;
}

#items li a:hover {
	color: #F00;
}
-->
</style>
</head>
<body>
	<div style="margin: 0 auto;width: 860px;font-size: 13px;">当前位置>>通知公告
		<div id="items" >
			<ul>
				<c:forEach items="${ notifications }" var="notification"
					varStatus="statu">

					<li><a
						href="${ pageContext.request.contextPath }/notification?nId=${ notification.id}">${ notification.title }</a>${ notification.timestr}</li>
				</c:forEach>
			</ul>
		</div>
		<div align="center">
			<a style="text-decoration: none; font-size: 12px;"
				href="${ pageContext.request.contextPath }/morenews?current=${ currentPage > 1 ? currentPage - 1 : 1}"><<上一页&nbsp;&nbsp;</a>
			<c:choose>
				<c:when test="${ pagecount <= 5 }">
					<c:forEach begin="1" end="${ pagecount }" var="index" step="1">
						<c:choose>
							<c:when test="${ index == currentPage }">
								<a style="color: red;"><c:out value="${ index }" /> </a>
							</c:when>
							<c:otherwise>
								<a style="text-decoration: none;"
									href="${ pageContext.request.contextPath }/morenews?current=${ index}"><c:out
										value="${ index }" /> </a>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</c:when>
				<c:when test="${ currentPage > pagecount - 2 }">
					<c:forEach begin="${ pagecount - 4 }" end="${ pagecount }" step="1"
						var="index">
						<c:choose>
							<c:when test="${ index == currentPage }">
								<a style="color: red;"><c:out value="${ index }" /> </a>
							</c:when>
							<c:otherwise>
								<a style="text-decoration: none;"
									href="${ pageContext.request.contextPath }/morenews?current=${ index}"><c:out
										value="${ index }" /> </a>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</c:when>
				<c:otherwise>
					<c:choose>
						<c:when test="${ currentPage > 3 }">
							<c:forEach begin="${ currentPage - 2 }"
								end="${ currentPage + 2 > pagecount ? pagecount : currentPage + 2}"
								step="1" var="index">
								<c:choose>
									<c:when test="${ index == currentPage }">
										<a style="color: red;"><c:out value="${ index }" /> </a>
									</c:when>
									<c:otherwise>
										<a style="text-decoration: none;"
											href="${ pageContext.request.contextPath }/morenews?current=${ index}"><c:out
												value="${ index }" /> </a>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</c:when>
						<c:otherwise>
							<c:forEach begin="1" end="${ pagecount < 5 ? pagecount : 5 }"
								var="index" step="1">
								<c:choose>
									<c:when test="${ index == currentPage }">
										<a style="color: red;"><c:out value="${ index }" /> </a>
									</c:when>
									<c:otherwise>
										<a style="text-decoration: none;"
											href="${ pageContext.request.contextPath }/morenews?current=${ index}"><c:out
												value="${ index }" /> </a>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</c:otherwise>
					</c:choose>
				</c:otherwise>
			</c:choose>
			<a style="text-decoration: none; font-size: 12px;"
				href="${ pageContext.request.contextPath }/morenews?current=${ currentPage < pagecount ? currentPage + 1 : pagecount}">&nbsp;&nbsp;下一页>></a>
		</div></div>
</body>
</html>